package com.yfp.device.api;

import com.yfp.common.core.domain.R;
import com.yfp.device.config.FeignConfig;
import com.yfp.system.api.factory.RemoteFileFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

@FeignClient(contextId = "yfp-auth", value = "yfp-auth", fallbackFactory = RemoteFileFallbackFactory.class, configuration = FeignConfig.class)

public interface AuthService {
    @PostMapping("machineLogin")
    R<Map<String, Object>> machineLogin(@RequestParam("machineSn") String machineSn, @RequestParam("base64MachinePwd") String base64MachinePwd);

    @DeleteMapping("machineLogout")
    R<?> logout(@RequestHeader("Authorization") String token);

    @PostMapping("machineRefresh")
    R<?> refresh(@RequestHeader("Authorization") String token);
}
